<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<script src="js/jquery-3.0.0.min.js"></script>
		<style type="text/css">
			#div001 {
				border: 10px solid #FF0000;
				border-radius: 15%;
				position: fixed;
				top: 200px;
				width: 600px;
				height: 400px;
				left: 100px;
				z-index: 10;
				background-color: #00FFFF;
				box-shadow: 10px 10px 5px #888888;
				/*transition: all 2s;*/
			}
			
			#div002 {
				border: 10px solid #FF0000;
				border-radius: 15%;
				position: fixed;
				top: 170px;
				width: 600px;
				height: 400px;
				left: 450px;
				z-index: 20;
				background-color: #1B6D85;
				box-shadow: 10px 10px 5px #888888;
				/*transition: all 2s;*/
			}
			
			#div003 {
				border: 10px solid #FF0000;
				border-radius: 15%;
				position: fixed;
				top: 200px;
				width: 600px;
				height: 400px;
				left: 800px;
				z-index: 10;
				background-color: #B2DBA1;
				box-shadow: 10px 10px 5px #888888;
				/*transition: all 2s;*/
			}
		</style>
	</head>

	<body>
		<div id="div001"></div>
		<div id="div002"></div>
		<div id="div003"></div>
	</body>

</html>
<script>
	var tay = 1;
	window.onload=a1();
	
	function rightaa(nowright) {
		return function rightaa() {
		$(center).animate({
			left: '100px'
		});
		$(right).animate({
			top: '170px',
			zIndex: '20'
		});
		$(left).animate({
			left: '800px'
		});
		$(center).animate({
			top: '200px',
			zIndex: '10'
		});
		$(right).animate({
			left: '450px'
		});
		tay++;
		if(tay >= 3) {
			tay = 1;
		}
		if(tay == 1) {
			a1();
		}
		if(tay == 2) {
			a2();
		}
		if(tay == 3) {
			a3();
		}
		nowright.removeEventListener("click", rightaa);
	}
	}
	
	$(right)[0].addEventListener("click", rightaa);

	function a1() {
		left = document.getElementById("div001");
		center = document.getElementById("div002");
		right = document.getElementById("div003");
	}

	function a2() {
		left = document.getElementById("div002");
		center = document.getElementById("div003");
		right = document.getElementById("div001");
	}

	function a3() {
		left = document.getElementById("div003");
		center = document.getElementById("div001");
		right = document.getElementById("div002");
	}
</script>